package org.checkboo.hopefullyengine.collision;

import org.checkboo.math.Vector3f;

public class Ray {
	
	private Vector3f origin;
	private Vector3f direction;
	
	public Ray(){
		this.origin = new Vector3f();
		this.direction = new Vector3f();
	}
	
	public Ray(Vector3f origin, Vector3f direction){
		this.origin = origin;
		this.direction = direction;
	}

	public void fromPoints(Vector3f point1, Vector3f point2){
		this.origin = point1;
		point2.subtractRes(point1, this.direction);
		this.direction.normalize();
	}

	public Vector3f getOrigin() {
		return origin;
	}

	public void setOrigin(Vector3f origin) {
		this.origin = origin;
	}

	public Vector3f getDirection() {
		return direction;
	}

	public void setDirection(Vector3f direction) {
		this.direction = direction;
	}
}